﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using XXX.Models.XXXEntities;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace XXX.api.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class SqlSugarDbFirstController : ControllerBase
    { 
        private readonly ILogger<SqlSugarDbFirstController> _logger;
        public SqlSugarDbFirstController( ILogger<SqlSugarDbFirstController> logger)
        {
           
            _logger = logger;
        }

        // GET: api/<DepartMentController>
        [HttpGet]
        public string Get()
        {

            //DataTable dt = new DataTable();

            ////HttpResponseMessage httpReponseMessage = new HttpResponseMessage();
            //string jsonstr = JsonConvert.SerializeObject(dt);
            ////httpReponseMessage.Content = new StringContent(jsonstr);
            return "";
            //return ReturnStd.Success(jsonstr);
        }

        [HttpPost]
        public string  Post(string cTableName)
        {

            SqlsugarHelper.Instance.DbFirst.Where(cTableName).CreateClassFile("D:\\客户\\宜兴中大纺织\\ZDEntity", "ZDEntity");

            
                return "ok";
           
        }


    }
}
